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 */
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;

  cursor: default;
  color: #888;
  background-color: #000;

  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%;
}

/* 画面适配由 settings.json 的 screen.designResolution.policy = 2 (SHOW_ALL)
   负责：等比缩放、完整可见、居中留黑边。这里不要再给 canvas 加 object-fit，
   否则会按 canvas 内部像素尺寸二次缩放，横竖屏切换后出现竖条。 */

: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);
}

/* ============================================================
   输入框文字颜色修复（白底白字看不见）
   ------------------------------------------------------------
   Cocos 3.8 Web 端在编辑态会生成一个 class="cocosEditBox" 的原生
   <input>/<textarea> 盖在游戏画面上，背景 transparent，文字颜色由引擎
   _updateTextLabel() 取 textLabel.color 写入内联 style.color。
   但该函数的缓存判定用的是 fontColor，label 后续被改成深色时不会刷新
   内联 color，于是停留在白色；而游戏里所有输入框底板都是白色
   (UIFactory.editBox 的 fillColor)，结果就是"白字 + 白底"。
   这里用 !important 压住引擎的内联样式，一次性覆盖登录/注册/昵称/
   聊天等全部输入框。背景保持透明，沿用游戏自绘白底，不改视觉。
   ============================================================ */
.cocosEditBox,
.cocosEditBox:focus {
  color: #1e1e1e !important;
  -webkit-text-fill-color: #1e1e1e !important;
  caret-color: #1e1e1e !important;
  background: transparent !important;
  background-color: transparent !important;
  opacity: 1 !important;
}

/* 浏览器"记住账号密码"自动填充会强制改底色/文字色，一并压住 */
.cocosEditBox:-webkit-autofill,
.cocosEditBox:-webkit-autofill:hover,
.cocosEditBox:-webkit-autofill:focus {
  color: #1e1e1e !important;
  -webkit-text-fill-color: #1e1e1e !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 9999s ease-out 0s !important;
}

/* 占位提示文字保持灰色可读（引擎会动态插入 #id::placeholder 规则） */
.cocosEditBox::-webkit-input-placeholder,
.cocosEditBox::placeholder {
  color: #8a8a8a !important;
  -webkit-text-fill-color: #8a8a8a !important;
}
