* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #9fd08a; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; user-select: none; }
#app { position: fixed; inset: 0; }
canvas { display: block; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud .hidden { display: none; }

#topbar {
  position: absolute; top: 12px; left: 16px;
  background: rgba(20, 30, 15, .55); color: #fff;
  padding: 8px 14px; border-radius: 10px; font-size: 15px; font-weight: bold;
  backdrop-filter: blur(4px); line-height: 1.5;
}
#online, #web-online, #visitors { color: #ffd95e; }

#board {
  position: absolute; top: 12px; right: 16px; min-width: 220px; max-width: 300px;
  background: rgba(20, 30, 15, .55); color: #fff;
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
  backdrop-filter: blur(4px);
  pointer-events: auto; cursor: pointer;
}
#board h3 { font-size: 13px; color: #ffd95e; margin-bottom: 6px; }
#board.collapsed #board-rows { display: none; }
#board.collapsed h3 { margin-bottom: 0; }
#board .row { display: flex; justify-content: space-between; gap: 16px; line-height: 1.7; }
#board .row.me { color: #ffd95e; }
#board .empty { color: #9db884; }

#feed {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.feed-item {
  background: rgba(20, 30, 15, .65); color: #ffe9b0; font-size: 13px;
  padding: 6px 14px; border-radius: 999px; animation: pop .25s ease-out;
  white-space: nowrap;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#ko-banner {
  position: absolute; top: 38%; left: 0; right: 0; text-align: center;
  color: #fff; font-size: 30px; font-weight: bold; text-shadow: 0 2px 8px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .2s;
}
#ko-banner.show { opacity: 1; }

#me {
  position: absolute; left: 16px; bottom: 16px; width: 260px;
  background: rgba(20, 30, 15, .55); border-radius: 10px; padding: 10px 14px;
  color: #fff; backdrop-filter: blur(4px);
}
#me-name { font-size: 14px; font-weight: bold; margin-bottom: 6px; }
#hpbar { height: 10px; background: rgba(255,255,255,.18); border-radius: 5px; overflow: hidden; }
#hpfill { height: 100%; width: 100%; background: linear-gradient(90deg, #7ec850, #b8e986); border-radius: 5px; transition: width .15s; }
#hpfill.low { background: linear-gradient(90deg, #e05252, #ff9a6b); }
#score { font-size: 12px; color: #cfe8b0; margin-top: 6px; }

/* 常驻操作提示（不随时间淡出） */
#hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.85); font-size: 13px;
  background: rgba(20,30,15,.45); padding: 6px 14px; border-radius: 999px;
  white-space: nowrap;
}
