/* 吉米卡丁车网页壳：游戏画面铺满整个浏览器窗口，无边框、无页眉页脚 */
html, body {
  width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #000;   /* 固定 16:9，窗口多出的部分显示为黑边 */
  cursor: default;
  font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
}

body, canvas, div {
  outline: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#GameDiv {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  /* iOS Safari 的地址栏会吃掉 100vh 的一部分：支持 dvh 的浏览器按动态视口高度铺满 */
  height: 100dvh;
  margin: 0;
  z-index: 1;
}

#Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

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

#JKBoot {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #f4f7ff;
  background: radial-gradient(ellipse at 50% 40%, #29474d 0%, #101b22 70%);
}
#JKBoot .t { font-size: 44px; font-weight: 800; color: #f4f7ed; letter-spacing: 4px; text-shadow: none; }
#JKBoot .bar { width: 280px; height: 8px; margin: 26px 0 14px; border-radius: 4px; background: #10232a; overflow: hidden; }
#JKBoot .bar i { display: block; width: 40%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #d6f576, #80e5da); animation: jkload 1.2s ease-in-out infinite; }
#JKBoot .s { font-size: 15px; color: #a8bec1; }
@keyframes jkload { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

: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);
}

/* ---- 移动端：竖屏遮罩（只允许横屏游玩）。深靛蓝底 + 旋转的手机图标 + 提示文字；横屏时隐藏 ---- */
#JKRotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  color: #f4f7ff;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #29474d 0%, #101b22 70%);
}
#JKRotate .ph { position: relative; width: 64px; height: 112px; margin-bottom: 28px; animation: jkrotate 2.2s ease-in-out infinite; }
#JKRotate .ph i {
  position: absolute; inset: 0; display: block; border-radius: 12px;
  border: 4px solid #80e5da; background: rgba(53, 212, 255, 0.10);
  box-shadow: 0 0 24px rgba(53, 212, 255, 0.35);
}
#JKRotate .ph i::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 22px; height: 4px; margin-left: -11px; border-radius: 2px; background: #80e5da; }
#JKRotate .t { font-size: 26px; font-weight: 800; color: #f4f7ed; letter-spacing: 2px; text-shadow: 0 3px 0 #132b30, 0 6px 18px rgba(0,0,0,.5); }
#JKRotate .s { margin-top: 10px; font-size: 14px; color: #a8bec1; }
@keyframes jkrotate {
  0%, 20% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}
/* 触屏设备竖屏时显示；?mobile=1 强制按手机处理；?mobile=0 强制关闭 */


/* 竖屏不再提示“请横屏”：很多人锁了自动旋转、微信内置浏览器也不一定跟着转，会一直卡在提示上。
   改由引擎把画面旋转 90° 横着显示（GameApp：view.setOrientation(LANDSCAPE)），竖着拿手机也能直接横握游玩。 */
#JKRotate { display: none !important; }

/* 手机竖屏：引擎启动前的加载画面也横过来显示（引擎启动后由引擎旋转游戏画面） */
@media (orientation: portrait) and (pointer: coarse) {
  #JKBoot { width: 100vh; height: 100vw; width: 100dvh; left: 100vw; top: 0; right: auto; bottom: auto; transform-origin: 0 0; transform: rotate(90deg); }
}

/* 手机：屏蔽长按菜单、选中、拖拽、双击放大、下拉刷新 / 回弹（输入框另行放开） */
html, body, #GameDiv, #GameCanvas {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-text-size-adjust: 100%;
}
input, textarea { -webkit-user-select: text; user-select: text; touch-action: manipulation; }

