  :root{ --night:#0d0b1e; --panel:#1a1730; --line:#3a3258; --gold:#e8c87a; --bone:#e8e0d0; }
  *{ margin:0; padding:0; box-sizing:border-box; }
  html,body{ width:100%; height:100%; background:var(--night); overflow:hidden; overscroll-behavior:none; }
  body{ display:flex; align-items:center; justify-content:center; font-family:"Microsoft YaHei","PingFang SC",sans-serif; }
  #game{
    width:min(100vw, calc(100vh * 16 / 9));
    height:min(100vh, calc(100vw * 9 / 16));
    /* 动态视口（移动端地址栏伸缩时画面不跳；不支持的浏览器自动回退上面两行） */
    width:min(100dvw, calc(100dvh * 16 / 9));
    height:min(100dvh, calc(100dvw * 9 / 16));
    image-rendering:pixelated; image-rendering:crisp-edges;
    touch-action:none; background:#000;
    /* 像素风箭头光标（白底黑边，热点在箭尖） */
    cursor:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 16 16' shape-rendering='crispEdges'><path d='M2 1 L2 12 L5 9 L7 13 L9 12 L7 8 L11 8 Z' fill='%23ffffff' stroke='%23000000' stroke-width='1'/></svg>") 2 1, auto;
    outline:none;
  }
  #boot{ position:absolute; color:var(--gold); font-size:14px; letter-spacing:4px; }

  /* —— 强制横屏引导（仅触屏设备竖屏时出现；PC 永远 pointer:fine，不受影响） —— */
  #rotate{ display:none; }
  @media (orientation:portrait) and (pointer:coarse){
    #rotate{
      display:flex; position:fixed; inset:0; z-index:9999;
      flex-direction:column; align-items:center; justify-content:center;
      gap:22px; padding:32px; text-align:center;
      background:var(--night); color:var(--gold);
    }
    #rotate .ico{
      width:72px; height:72px;
      animation:rot-tip 1.8s ease-in-out infinite;
      transform-origin:50% 50%;
    }
    #rotate .ico svg{ width:100%; height:100%; display:block; }
    #rotate .t1{ font-size:18px; letter-spacing:3px; font-weight:bold; }
    #rotate .t2{ font-size:13px; letter-spacing:1px; color:var(--bone); opacity:.8; }
    /* 竖屏时隐藏画布，避免误触游戏 */
    #game{ visibility:hidden; }
  }
  @keyframes rot-tip{
    0%,100%{ transform:rotate(0deg); }
    50%{ transform:rotate(90deg); }
  }

  /* —— 安装门禁：手机浏览器内（非主屏幕全屏）挡住游戏，引导添加到主屏幕 —— */
  #installgate[hidden]{ display:none; }
  #installgate{
    position:fixed; inset:0; z-index:10000;
    display:flex; align-items:center; justify-content:center;
    padding:24px; background:var(--night); color:var(--bone);
    -webkit-user-select:none; user-select:none;
  }
  #installgate .ig-box{
    max-width:520px; width:100%;
    display:flex; flex-direction:column; align-items:center; gap:16px;
    text-align:center;
  }
  #installgate .ig-ico{ width:64px; height:64px; }
  #installgate .ig-ico img{ width:100%; height:100%; border-radius:14px; }
  #installgate .ig-t1{ font-size:18px; font-weight:bold; color:var(--gold); letter-spacing:2px; }
  #installgate .ig-steps{
    font-size:14px; line-height:2; color:var(--bone);
    background:var(--panel); border:1px solid var(--line); border-radius:12px;
    padding:14px 20px; text-align:left;
  }
  #installgate .ig-steps b{ color:var(--gold); }
  #installgate .ig-note{ font-size:12px; color:var(--bone); opacity:.6; }
