/* style.css — 灰盒页面样式（story-001）。
   仅 index.html 的 <link> 引用；容器规范：无外部资源。 */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 320x240 逻辑分辨率，等比放大保持像素风。
   不用 aspect-ratio（Chrome 88+，超出 61 基线）；
   canvas 是替换元素，仅用 max 约束即保持内在外在比例。 */
canvas {
  image-rendering: pixelated;
  max-width: 100vw;
  max-height: 100vh;
  touch-action: none; /* story-002 触屏输入前置：阻止容器触摸滚动/缩放 */
}

/* 静音开关（story-003）：DOM 按钮而非 canvas 内绘制，固定右上角 */
#mute-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  background: #1d1d26;
  color: #c8b273;
  border: 1px solid #4a4a58;
  font-size: 14px;
  touch-action: manipulation; /* 防触屏双击缩放延迟 */
}

/* 环境状态栏（story-004）：显示当前是否在小红书容器内（振动可用性），供真机验证 */
#env-status {
  position: fixed;
  bottom: 8px;
  left: 8px;
  color: #8a8a9a;
  font-size: 12px;
}

/* 操作引导（真机反馈修复①）：新玩家首屏提示。半透明浮层置于顶部居中 ——
   避开左半屏（逻辑 x<160 即屏宽 50%）摇杆活动区中央；
   pointer-events:none 触控穿透，不劫持 canvas 上的摇杆/音频首触监听；
   首次触摸加 .hint-fade 淡出（0.4s 过渡），450ms 后 .hint-gone 移出布局。 */
#hint {
  position: fixed;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 88%;
  padding: 8px 14px;
  background: rgba(29, 29, 38, 0.72);
  border: 1px solid rgba(74, 74, 88, 0.6);
  color: #d8c88a;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}

#hint.hint-fade {
  opacity: 0;
}

#hint.hint-gone {
  display: none;
}
