/*
 * style.css — 共享引擎样式：全屏黑底 + 封面铺满 + 屏蔽系统手势干扰。
 * 游戏页引用方式：<link rel="stylesheet" href="../engine/style.css">
 * 同时必须在 <head> 里带 viewport meta（见各 index.html）：
 *   <meta name="viewport" content="width=device-width, initial-scale=1,
 *     maximum-scale=1, user-scalable=no, viewport-fit=cover">
 */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  /* 防下拉刷新 / 橡皮筋回弹 */
  overscroll-behavior: none;
}

/* 游戏全屏根元素：手势全屏捕获层 */
#game-root {
  position: fixed;
  inset: 0;
  /* 浏览器原生手势全部禁用，交给 engine/gesture.js */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;      /* iOS 长按弹菜单 */
  -webkit-tap-highlight-color: transparent;
}

/* 封面图：居中铺满（裁切多余部分） */
#game-root img.cover,
#start-overlay img.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 启动遮罩层：封面 + “轻触开始”（audio.showStartOverlay 创建） */
#start-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#start-overlay .hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 30%;                 /* 屏幕中间偏上，避开封面图底部文字区 */
  text-align: center;
  color: #fff;
  font: 500 20px/1.5 system-ui, sans-serif;
  letter-spacing: 0.2em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  animation: start-overlay-pulse 1.6s ease-in-out infinite;
}

@keyframes start-overlay-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* ---- 震动视觉降级（haptics.js，iOS 等无 vibrate 平台） ----
   全屏边框闪光覆盖层：震型 → 颜色/闪烁次数（hp-once/twice/thrice）。 */
#haptics-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  border-style: solid;
  border-width: 6px;
  border-radius: 4px;
}
#haptics-flash.hp-once   { animation: hp-flash 0.28s ease-out 1; }
#haptics-flash.hp-twice  { animation: hp-flash 0.24s ease-out 2; }
#haptics-flash.hp-thrice { animation: hp-flash 0.2s ease-out 3; }
@keyframes hp-flash {
  0%   { opacity: 0; }
  20%  { opacity: var(--hp-alpha, 1); }
  100% { opacity: 0; }
}
