html {
  -ms-touch-action: none;
  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-color: #333;

  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: rgba(0, 0, 0, 0);
}

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: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.animated-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 25%, #2d1b4e 50%, #1a1a3e 75%, #0a0a1a 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(61, 197, 222, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 40% 20%, rgba(255, 20, 147, 0.1) 0%, transparent 50%);
  animation: overlayPulse 8s ease-in-out infinite;
}

@keyframes overlayPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(61, 197, 222, 0.8), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(138, 43, 226, 0.8), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(61, 197, 222, 0.6), transparent),
    radial-gradient(2px 2px at 90% 80%, rgba(138, 43, 226, 0.6), transparent),
    radial-gradient(1px 1px at 33% 85%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(2px 2px at 15% 60%, rgba(61, 197, 222, 0.7), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255, 20, 147, 0.5), transparent);
  background-size: 200% 200%;
  background-position: 0% 0%;
  animation: particlesMove 20s linear infinite;
  opacity: 0.6;
}

@keyframes particlesMove {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(61, 197, 222, 0.1) 25%, 
    rgba(138, 43, 226, 0.1) 50%, 
    rgba(61, 197, 222, 0.1) 75%, 
    transparent 100%);
  animation: waveMove 10s linear infinite;
  opacity: 0.5;
}

.wave1 {
  height: 120px;
  animation-duration: 12s;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(61, 197, 222, 0.08) 30%, 
    rgba(138, 43, 226, 0.08) 60%, 
    transparent 100%);
}

.wave2 {
  height: 100px;
  animation-duration: 15s;
  animation-direction: reverse;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(138, 43, 226, 0.06) 40%, 
    rgba(61, 197, 222, 0.06) 70%, 
    transparent 100%);
}

.wave3 {
  height: 80px;
  animation-duration: 18s;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 20, 147, 0.05) 35%, 
    rgba(61, 197, 222, 0.05) 65%, 
    transparent 100%);
}

@keyframes waveMove {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-20px);
  }
  100% {
    transform: translateX(-50%) translateY(0);
  }
}

.splash-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  z-index: 10;
}

.logo-container {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo {
  width: 144px;
  height: 144px;
  object-fit: contain;
  z-index: 2;
  position: relative;
  animation: logoPulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(61, 197, 222, 0.6));
}

@keyframes logoPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.circular-progress {
  position: absolute;
  width: 240px;
  height: 240px;
  transform: rotate(-90deg);
  z-index: 1;
}

.progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
  stroke-linecap: round;
}

.progress-bar-circle {
  fill: none;
  stroke: #3dc5de;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(61, 197, 222, 0.8));
}

.progress-text {
  margin-top: 36px;
  font-size: 29px;
  font-weight: bold;
  color: #3dc5de;
  text-shadow: 0 0 10px rgba(61, 197, 222, 0.8);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 2px;
}

/* Responsive design */
@media (max-width: 480px) {
  .logo-container {
    width: 180px;
    height: 180px;
  }
  
  .splash-logo {
    width: 108px;
    height: 108px;
  }
  
  .circular-progress {
    width: 180px;
    height: 180px;
  }
  
  .progress-text {
    font-size: 22px;
    margin-top: 24px;
  }
}

@media (max-height: 600px) {
  .logo-container {
    width: 180px;
    height: 180px;
  }
  
  .splash-logo {
    width: 108px;
    height: 108px;
  }
  
  .circular-progress {
    width: 180px;
    height: 180px;
  }
  
  .progress-text {
    font-size: 22px;
    margin-top: 18px;
  }
}
