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-color: #333;

  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%;
  height: 100%;
}

#GameLoading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 246, 230, 0.78), rgba(255, 246, 230, 0.78)),
    url("assets/main/native/e8/e87fc906-a58c-411f-9202-ccfa017b597b.png") center/cover no-repeat,
    #f4c7a7;
  opacity: 1;
  transition: opacity 260ms ease, visibility 260ms ease;
}

#GameLoading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-stage {
  width: min(78vw, 420px);
  color: #4f302d;
  text-align: center;
}

.loading-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.85);
}

.loading-subtitle {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
}

.loading-track {
  height: 14px;
  margin-top: 28px;
  overflow: hidden;
  border: 3px solid #4f302d;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 3px 0 rgba(79, 48, 45, 0.18);
}

#LoadingBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffce4f, #f06e51);
  transition: width 180ms ease;
}

#LoadingText {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
}

#TgRankLayer {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

#TgRankButton {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  min-width: 84px;
  height: 38px;
  padding: 0 14px;
  border: 2px solid #5c322d;
  border-radius: 8px;
  color: #44211d;
  background: linear-gradient(#ffe58d, #ffb94e);
  box-shadow: 0 3px 0 rgba(92, 50, 45, 0.28);
  font-size: 16px;
  font-weight: 800;
  pointer-events: auto;
}

#TgRankButton:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(92, 50, 45, 0.28);
}

#TgRankModal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(42, 25, 23, 0.48);
  pointer-events: auto;
}

#TgRankModal[hidden] {
  display: none;
}

.rank-dialog {
  width: min(88vw, 390px);
  max-height: min(74vh, 620px);
  overflow: hidden;
  border: 3px solid #5c322d;
  border-radius: 8px;
  background: #fff5d8;
  box-shadow: 0 12px 0 rgba(92, 50, 45, 0.24);
  color: #44211d;
  text-align: left;
}

.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 2px solid rgba(92, 50, 45, 0.18);
  background: #ffe7a8;
}

.rank-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.rank-subtitle {
  margin-top: 4px;
  color: #8b5a42;
  font-size: 13px;
  font-weight: 700;
}

#TgRankClose {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #5c322d;
  border-radius: 8px;
  color: #44211d;
  background: #fff8e8;
  font-size: 26px;
  font-weight: 800;
  line-height: 28px;
}

.rank-list {
  max-height: calc(min(74vh, 620px) - 76px);
  overflow: auto;
  padding: 10px 12px 14px;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(92, 50, 45, 0.12);
}

.rank-index {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #ffce57;
  color: #44211d;
  font-size: 16px;
  font-weight: 900;
  line-height: 30px;
  text-align: center;
}

.rank-name {
  max-width: 190px;
  overflow: hidden;
  color: #44211d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-handle {
  min-height: 16px;
  margin-top: 2px;
  overflow: hidden;
  color: #9a6b53;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-time {
  min-width: 52px;
  color: #db583d;
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.rank-empty {
  padding: 28px 12px;
  color: #8b5a42;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}
