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 {
  -webkit-appearance: none;
  margin: 0;
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  cursor: default;
  color: #888;
  background-color: #0d0f14;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#GameDiv {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 500px;
  max-height: 1080px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  background: #000;
}

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

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

#splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1b2838 0%, #080c14 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99;
  transition: opacity 0.5s ease-out;
}

#splash.hide {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  width: 140px;
  height: 140px;
  margin-bottom: 24px;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.15); }
  100% { transform: scale(1); filter: brightness(1); }
}

#loading-text {
  color: #e2c08d;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.progress-bar {
  background-color: rgba(255, 255, 255, 0.1);
  height: 8px;
  padding: 2px;
  width: 260px;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
  overflow: hidden;
}

.progress-bar span {
  display: inline-block;
  height: 100%;
  background-color: #f39c12;
  background-image: linear-gradient(90deg, #e67e22, #f1c40f, #e67e22);
  border-radius: 6px;
  transition: width 0.2s ease-in-out;
}

#browser-enter-loading {
  position: absolute;
  z-index: 100000;
  left: 50%;
  top: 54%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff2cf;
  background: rgba(35, 20, 12, 0.9);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#browser-enter-loading.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.browser-enter-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #f6c453;
  border-radius: 50%;
  animation: browser-enter-spin 0.8s linear infinite;
}

@keyframes browser-enter-spin {
  to { transform: rotate(360deg); }
}

#browser-account-panel {
  position: absolute;
  z-index: 100001;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: linear-gradient(180deg, rgba(7, 21, 25, 0.38), rgba(5, 13, 17, 0.9));
  backdrop-filter: blur(5px);
}

#browser-account-panel.show { display: flex; }

#browser-account-logout {
  position: absolute;
  z-index: 100002;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 239, 191, 0.82);
  border-radius: 9px;
  color: #fff6df;
  background: rgba(43, 27, 22, 0.9);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

#browser-account-logout[hidden] { display: none; }

.browser-account-card {
  width: min(100%, 360px);
  padding: 24px 22px 20px;
  border: 1px solid rgba(239, 207, 132, 0.65);
  border-radius: 18px;
  color: #f9f1db;
  background: linear-gradient(155deg, rgba(28, 67, 69, 0.97), rgba(14, 35, 43, 0.98));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62), inset 0 1px rgba(255, 255, 255, 0.12);
  text-align: left;
}

.browser-account-logo {
  color: #f4d27c;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 3px 8px #000;
}

.browser-account-subtitle {
  margin: 6px 0 18px;
  color: #c7d9d2;
  font-size: 13px;
  text-align: center;
}

.browser-account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.24);
}

.browser-account-tabs button {
  padding: 9px 6px;
  border: 0;
  border-radius: 8px;
  color: #9eb9b4;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.browser-account-tabs button.active {
  color: #2e2919;
  background: linear-gradient(180deg, #f9dd8a, #dcae51);
}

.browser-account-form label {
  display: block;
  margin: 11px 0;
  color: #c9ddd7;
  font-size: 12px;
  font-weight: 650;
}

.browser-account-form input,
.browser-account-form select {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid rgba(184, 217, 205, 0.28);
  border-radius: 9px;
  outline: none;
  color: #fff;
  background: rgba(3, 15, 20, 0.62);
  font-size: 15px;
  user-select: text;
  -webkit-user-select: text;
}

.browser-account-form input:focus,
.browser-account-form select:focus { border-color: #e7c269; }

.browser-account-error {
  min-height: 18px;
  margin: 7px 0;
  color: #ffad98;
  font-size: 12px;
  text-align: center;
}

.browser-account-submit {
  width: 100%;
  min-height: 46px;
  border: 1px solid #ffe5a1;
  border-radius: 10px;
  color: #34220f;
  background: linear-gradient(180deg, #ffe6a0, #dea94e);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.browser-account-submit:disabled { opacity: 0.6; cursor: wait; }

.browser-account-note {
  margin-top: 12px;
  color: #819f9a;
  font-size: 11px;
  text-align: center;
}
