.game-hud { --game-user-color:#92745d; --game-peer-color:#887761; --game-edge:16px; position:absolute; inset:0; z-index:45; color:#fff9ee; font:13px/1.45 Arial,"PingFang SC","Microsoft YaHei",sans-serif; pointer-events:none; user-select:none; }
.game-hud *, .game-hud *::before, .game-hud *::after { box-sizing:border-box; }
.game-hud [hidden] { display:none !important; }
.game-hud button,.game-hud select,.game-hud textarea { font:inherit; color:inherit; }
.game-hud button { min-height:44px; padding:10px 14px; border:1px solid #c6baaa; border-radius:12px; background:rgba(81,70,58,.92); cursor:pointer; pointer-events:auto; touch-action:manipulation; }
.game-hud button:disabled { opacity:.58; cursor:default; }
.game-hud :is(button,select,textarea):focus-visible { outline:3px solid #fae2b2; outline-offset:3px; }
.game-look { position:absolute; inset:0; pointer-events:auto; touch-action:none; cursor:grab; }
.game-look:active { cursor:grabbing; }
.game-touch .game-look { left:35%; }
.game-labels { position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.game-top { position:absolute; top:max(var(--game-edge),env(safe-area-inset-top)); left:max(var(--game-edge),env(safe-area-inset-left)); right:max(var(--game-edge),env(safe-area-inset-right)); display:flex; align-items:flex-start; justify-content:space-between; gap:12px; z-index:4; }
.game-identity { min-width:0; max-width:calc(100% - 116px); display:flex; align-items:center; gap:9px; min-height:46px; padding:7px 12px; background:rgba(70,61,51,.87); border:1px solid #b9ab97; border-radius:12px; }
.game-avatar-dot { flex:0 0 12px; width:12px; height:12px; background:var(--game-user-color); border:2px solid #fff4de; border-radius:50%; }
.game-identity-copy { min-width:0; display:flex; flex-direction:column; }
.game-name { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:500; }
.game-online { font-size:10px; opacity:.85; white-space:nowrap; }
.game-exit { flex:none; white-space:nowrap; }
.game-connection { position:absolute; top:calc(max(var(--game-edge),env(safe-area-inset-top)) + 58px); left:max(var(--game-edge),env(safe-area-inset-left)); max-width:min(420px,calc(100% - 32px)); display:flex; align-items:center; gap:10px; padding:7px 9px 7px 12px; background:rgba(77,59,40,.96); border-radius:10px; pointer-events:auto; z-index:5; font-size:12px; }
.game-connection-text { min-width:0; }
.game-hud .game-retry { padding:6px 12px; flex:none; }
.game-chat { position:absolute; top:calc(max(var(--game-edge),env(safe-area-inset-top)) + 60px); right:max(var(--game-edge),env(safe-area-inset-right)); width:min(300px,calc(100% - 32px)); max-height:calc(100% - 255px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow:auto; background:rgba(58,51,44,.96); border:1px solid #c0b4a4; border-left:3px solid var(--game-peer-color); border-radius:12px; pointer-events:auto; z-index:5; touch-action:pan-y; }
.game-hud .game-chat-toggle { width:100%; min-height:44px; border:0; border-radius:10px; background:transparent; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.game-chat-body { padding:0 12px 11px; }
.game-target-label { display:flex; align-items:center; gap:8px; font-size:11px; }
.game-target { min-width:0; flex:1; height:44px; border:1px solid #c6baaa; border-radius:7px; padding:6px; background:#5e5346; }
.game-chat-hint { margin:0 0 9px; font-size:10px; opacity:.8; }
.game-chat-form { display:flex; align-items:stretch; gap:8px; margin:0; }
.game-chat-input { flex:1; min-width:0; min-height:54px; max-height:90px; resize:none; padding:8px; color:#322e29 !important; background:#f3eddf; border:1px solid #c6baaa; border-radius:8px; user-select:text; touch-action:auto; font-size:16px !important; }
.game-chat-input::placeholder { color:#786b5b; }
.game-hud .game-chat-send { flex:0 0 48px; padding:8px; border-radius:8px; }
.game-chat-count { display:block; margin-top:4px; text-align:right; font-size:9px; opacity:.72; }
.game-notice { position:absolute; bottom:calc(max(18px,env(safe-area-inset-bottom)) + 150px); left:50%; transform:translateX(-50%); margin:0; max-width:min(470px,calc(100% - 32px)); padding:8px 12px; background:rgba(64,55,47,.9); border-radius:9px; font-size:11px; text-align:center; }
.game-actions { position:absolute; bottom:max(40px,calc(env(safe-area-inset-bottom) + 28px)); right:max(var(--game-edge),env(safe-area-inset-right)); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:210px; gap:8px; pointer-events:auto; z-index:3; }
.game-actions .game-camera-reset { grid-column:1 / -1; }
.game-actions button { min-width:0; padding:10px 7px; line-height:1.2; }
.game-jump { background:#8a6c50 !important; }
.game-help { position:absolute; left:50%; bottom:max(6px,env(safe-area-inset-bottom)); transform:translateX(-50%); margin:0; padding:4px 10px; border-radius:8px; background:rgba(64,55,47,.76); font-size:10px; white-space:nowrap; }
.game-joystick { position:absolute; display:none; align-items:center; justify-content:center; bottom:max(49px,calc(env(safe-area-inset-bottom) + 38px)); left:max(25px,env(safe-area-inset-left)); width:112px; height:112px; border-radius:50%; border:1px solid #e0d3be; background:rgba(101,86,69,.48); touch-action:none; pointer-events:auto; z-index:3; }
.game-touch .game-joystick { display:flex; }
.game-joystick-thumb { width:43px; height:43px; border-radius:50%; border:1px solid #fff3df; background:rgba(239,225,201,.91); pointer-events:none; }
.game-joystick-caption { position:absolute; bottom:-22px; font-size:10px; background:rgba(64,55,47,.85); padding:2px 8px; border-radius:7px; }
.game-touch .game-actions { width:144px; }
.game-touch .game-help { bottom:max(7px,env(safe-area-inset-bottom)); }
.game-typing .game-look,.game-typing .game-joystick { pointer-events:none; }
.game-typing .game-joystick,.game-typing .game-actions,.game-typing .game-help,.game-typing .game-notice { visibility:hidden; }
.game-typing .game-chat { max-height:calc(100% - 95px - env(safe-area-inset-top)); }
@media(max-width:380px) {
  .game-hud { --game-edge:10px; }
  .game-joystick { left:max(17px,env(safe-area-inset-left)); width:100px; height:100px; }
  .game-touch .game-actions { width:136px; gap:6px; }
  .game-chat { width:calc(100% - 20px); }
  .game-name { max-width:122px; }
}
@media(max-height:500px) and (min-width:600px) {
  .game-hud { --game-edge:10px; }
  .game-chat { top:calc(max(10px,env(safe-area-inset-top)) + 54px); right:50%; transform:translateX(50%); width:min(320px,calc(100% - 310px)); max-height:calc(100% - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .game-chat-hint { display:none; }
  .game-chat-body { padding:0 9px 7px; }
  .game-chat-input { min-height:44px; height:44px; }
  .game-chat-count { margin-top:2px; }
  .game-joystick { width:92px; height:92px; bottom:max(38px,calc(env(safe-area-inset-bottom) + 28px)); }
  .game-actions { bottom:max(30px,calc(env(safe-area-inset-bottom) + 20px)); }
  .game-notice { bottom:max(36px,calc(env(safe-area-inset-bottom) + 26px)); width:calc(100% - 340px); }
  .game-typing .game-chat { width:min(380px,calc(100% - 24px)); max-height:calc(100% - 76px - env(safe-area-inset-top)); }
}
