:root {
  --color-main: #2ebee6;
  --color-success: #39e691;
  --color-splash-connect: #2e9990;
  --color-splash-success: #39e691;
}

@font-face {
  font-family: "Inter";
  src: url(./fonts/Inter-Regular.ttf);
}

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 */
}

/* Ẩn mũi tên trên Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;

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

  display: flex;
  flex-direction: column;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

#GameDiv,
#Cocos3dGameContainer,
#GameCanvas {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  position: relative;
}

#webview-wrapper:not(.webview-iframe) {
  width: 100% !important;
  height: 100% !important;
  transform: matrix(1, 0, 0, 1, 0, 0) !important;
}

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}

#splash-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  background-color: white;
  transition: all 0.2s ease-out;
}

#splash-animation {
  width: 45%;
  height: 45%;
  position: absolute;
  background-color: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.2s ease-out;
}

#splash-video {
  width: 60%;
  height: 60%;
  position: absolute;
  background-color: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.2s ease-out;
}

@media screen and (max-width: 800px) {
  #splash-animation {
    width: 85%;
  }
  #splash-video {
    width: 100%;
  }
}

#splash-bg > div {
  display: none;
}

#splash-bg > div.show {
  display: block;
  height: 100%;
  width: 100%;
}

.loadingAnim {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  height: 100%;
  position: relative;
  z-index: 10;
}
.loadingAnim .dots {
  display: flex;
  gap: 4px;
  zoom: 1.7;
}
.loadingAnim .dots > div {
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background-color: #205caa;
  margin-bottom: 10px;
}
.loadingAnim .dots > div:first-child {
  animation: anim 750ms linear infinite;
}
.loadingAnim .dots > div:nth-child(2) {
  animation: anim 750ms linear infinite 100ms;
}
.loadingAnim .dots > div:nth-child(3) {
  animation: anim 750ms linear infinite 200ms;
}
.loadingAnim .text {
  font-size: 12px;
  color: var(--color-text-emphasize);
}

@keyframes anim {
  50% {
    transform: translateY(8px);
  }
}

#ss_image {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#ss_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#ss_text.show {
  display: flex !important;
  justify-content: center;
  align-items: center;
}

#splash-bg #ss_text > div {
  font-size: 45px;
}

#ss_default {
  background: #161616;
}

.ss_default-box {
  padding: 130px 45px 25px 45px;
}

.ss_default-text {
  font-size: 55px;
  text-align: left;
  border-bottom: 3px solid var(--color-main);
  padding-bottom: 12px;
  color: var(--color-main);
  letter-spacing: 1.3px;
}

.ss_default-text.success {
  border-bottom: 3px solid var(--color-success);
  color: var(--color-success);
}

.ss_default-desc {
  font-size: 21px;
  text-align: left;
  padding-bottom: 3px;
  letter-spacing: 1.5px;
  padding-top: 24px;
  color: #a9a9a9;
  opacity: 0;
}

.ss_default-desc.show {
  opacity: 1;
}

.connectContainer {
  position: absolute;
  width: 100vw;
  height: 100vh;
  height: 100vh;
  top: 0;
  left: 0;
  font-family: "Inter";
  background-color: #0a0a0a;
}

.connectBox {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin: 170px 75px 75px 75px;
  gap: 17px;
}

.connectBox .text {
  font-size: 48px;
  letter-spacing: 1.3px;
  color: var(--color-splash-connect);
}

.connectBox .line {
  height: 4px;
  background-color: var(--color-splash-connect);
}

.connectSuccessfully,
.successDesc {
  display: none;
}

.success .connecting {
  display: none;
}
.success .connectSuccessfully {
  display: block;
  color: var(--color-splash-success);
}
.success .successDesc {
  display: block;
  color: #fff;
  letter-spacing: 1.3px;
  margin-top: 10px;
  font-size: 16px;
}

.success .line {
  background-color: var(--color-splash-success);
}

.hideSplash {
  opacity: 0;
  z-index: 1;
}

@media screen and (max-width: 996px) {
  .connectBox {
    margin: 100px 50px 50px 50px;
  }

  .connectBox .text {
    font-size: 38px;
  }

  .connectBox .line {
    height: 3px;
  }
}

@media screen and (max-width: 768px) {
  .connectBox {
    margin: 100px 35px 35px 35px;
    gap: 10px;
  }

  .connectBox .text {
    font-size: 24px;
  }

  .connectBox .line {
    height: 2px;
  }

  .connectBox .successDesc {
    font-size: 12px;
    margin-top: 0;
  }
}

@media screen and (max-width: 515px) {
  .connectBox {
    margin: 65px 15px 15px 15px;
  }

  .connectBox .text {
    font-size: 18px;
  }

  .connectBox .successDesc {
    font-size: 10px;
    margin-top: 0;
  }
}

@media screen and (max-width: 375px) {
  .connectBox {
    margin: 65px 12px 12px 12px;
  }

  .connectBox .text {
    font-size: 16px;
  }

  .connectBox .successDesc {
    font-size: 8px;
    margin-top: 0;
  }
}

#jcontainer {
  position: fixed;
  z-index: 99999;
  background: #212020 no-repeat center;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  transition: all 211ms linear;
}

.jloading {
  width: 100%;
  position: absolute;
  top: calc(50% - 50px);
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 211ms linear;
}

.jloading img {
  width: 300px;
  animation: fadeIn 211ms ease-in;
}

.jloading .progress {
  width: 720px;
  height: 11px;
  /* border: 1px solid #fec035; */
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  transition: all 211ms linear;
}

.jloading .progress .progress-bar {
  width: 0%;
  height: 100%;
  background: #fec035;
  background: linear-gradient(90deg, rgba(254, 192, 53, 1) 0%, rgba(196, 38, 38, 1) 100%);
  transition: width 211ms;
}

.progress-bar.full {
  width: 100% !important;
}

.hide {
  opacity: 0;
}

.deplay-100ms {
  transition-delay: 1000ms;
}

.loading-text {
  color: whitesmoke;
  margin-top: 20px;
  font-size: 14px;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.weak-network-toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 99999;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: min(
    100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px),
    460px
  );
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.weak-network-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: #ffb020;
  color: #221300;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.weak-network-toast__text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media screen and (max-width: 760px) {
  .jloading img {
    width: 200px;
  }

  .jloading .progress {
    width: 480px;
    height: 9px;
    bottom: -20px;
  }
}

@media screen and (max-width: 515px) {
  .jloading img {
    width: 170px;
  }

  .jloading .progress {
    width: calc(100% - 40px);
    height: 8px;
  }

  .weak-network-toast {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-width: calc(
      100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)
    );
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 14px;
  }
}

@media screen and (max-width: 370px) {
  .jloading img {
    width: 150px;
  }
}
