html,body{margin:0;height:100%;background:#111;overscroll-behavior:none}
body{display:flex;flex-direction:column}
#stage{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center}
#lcd{image-rendering:pixelated}

/* ===== 手机外壳（仿移植版布局，仅粗指针设备显示）===== */
#status-bar,#touch-controls{display:none}
/* 结构样式不进媒体查询——显隐单独由 pointer:coarse 控制 */
#status-bar{
  justify-content:space-between;align-items:center;
  padding:calc(6px + env(safe-area-inset-top)) 12px 6px;
  font:600 17px -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;
  color:#111;background:#fff;
}
#touch-controls{
  flex-direction:column;flex:0 0 auto;gap:14px;
  padding:14px 10px calc(14px + env(safe-area-inset-bottom));
  user-select:none;-webkit-user-select:none;background:#fff;
}
@media (pointer: coarse){
  body{background:#fff}
  #status-bar{display:flex}
  #touch-controls{display:flex}
}
.tc-row{display:flex;gap:8px;justify-content:space-between}
/* 中间三键（方向）连成一条，与截图一致 */
.tc-row .tc-btn{flex:1 1 0}
.tc-row .tc-set,.tc-row .tc-qinggong,.tc-row .tc-cancel,.tc-row .tc-confirm{flex:0 0 21%}
.tc-row .tc-ll+ .tc-up,.tc-row .tc-up+ .tc-rr,
.tc-row .tc-left+ .tc-down,.tc-row .tc-down+ .tc-right{margin-left:-8px;border-left:1px solid #8a8577}
.tc-btn{
  position:relative;touch-action:none;-webkit-tap-highlight-color:transparent;
  background:#d3c9b6;color:#222;
  border:0;border-bottom:6px solid #6f7480;border-radius:2px;
  font-size:19px;font-family:-apple-system,"PingFang SC",sans-serif;
  min-height:96px;
}
.tc-btn.tc-active{background:#bdb29c;border-bottom-width:3px}
.tc-dot{position:absolute;top:10px;left:12px;width:12px;height:12px;border-radius:50%;background:#e0281e}
/* 横屏压扁 */
@media (pointer: coarse) and (orientation: landscape){
  .tc-btn{min-height:52px;font-size:15px}
  #touch-controls{gap:8px;padding:8px 10px calc(8px + env(safe-area-inset-bottom))}
  #status-bar{font-size:14px;padding-top:calc(2px + env(safe-area-inset-top))}
}
